home *** CD-ROM | disk | FTP | other *** search
- /*
- * These files are for informational purposes and can demonstrate how
- * to write your own mixed-mode GL-based widgets. However SGI does not
- * guarantee that this source code absolutely matches the GLxDraw
- * widget that is shipped as part of the system.
- */
-
- /***********************************************************
- Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
- and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
-
- All Rights Reserved
-
- Permission to use, copy, modify, and distribute this software and its
- documentation for any purpose and without fee is hereby granted,
- provided that the above copyright notice appear in all copies and that
- both that copyright notice and this permission notice appear in
- supporting documentation, and that the names of Digital or MIT not be
- used in advertising or publicity pertaining to distribution of the
- software without specific, written prior permission.
-
- DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- SOFTWARE.
-
- ******************************************************************/
-
- #ifndef _GlxDraw_h
- #define _GlxDraw_h
-
- #ifdef USE_GL
- #include <gl/glws.h>
- #else
- #include <GL/glx.h>
- #endif /* USE_GL */
-
- /****************************************************************
- *
- * GlxDraw widgets
- *
- ****************************************************************/
-
- /* Resources:
-
- Name Class RepType Default Value
- ---- ----- ------- -------------
- destroyCallback Callback Pointer NULL
- exposeCallback Callback Pointer NULL
- ginitCallback Callback Pointer NULL
- inputCallback Callback Pointer NULL
- resizeCallback Callback Pointer NULL
-
- overlayExposeCallback Callback Pointer NULL
- underlayExposeCallback Callback Pointer NULL
- popupExposeCallback Callback Pointer NULL
-
- glxConfig GlxConfig GLXconfig * {{0,0,0}}
- glxContext GlxContext GLXContext 0
- visual Visual Visual NULL
- overrideColormap OverrideColormap Boolean TRUE
- useOverlay UseOverlay Boolean FALSE
- overlayColormap Colormap Colormap NULL
- overlayDepth Depth int 0
- overlayVisual Visual VisualInfo NULL
- overlayWindow Window Window 0
- overlayContext GLXContext GLXContext 0
- overlayGlxConfig GlxConfig int * NULL
- useUnderlay UseUnderlay Boolean FALSE
- underlayColormap Colormap Colormap NULL
- underlayDepth Depth int 0
- underlayVisual Visual VisualInfo NULL
- underlayWindow Window Window 0
- usePopup UsePopup Boolean FALSE
- popupColormap Colormap Colormap NULL
- popupDepth Depth int 0
- popupVisual Visual VisualInfo NULL
- popupWindow Window Window 0
-
- provideSingleBuffer ProvideSingleBuffer Boolean FALSE
- singleBuffer SingleBuffer Boolean ?
- provideStereoBuffer ProvideStereoBuffer Boolean FALSE
- stereoBuffer StereoBuffer Boolean ?
- altColormap Colormap Colormap NULL
- mainWindow Window Window 0
- */
-
- #define GlxNglxConfig "glxConfig"
- #define GlxCGlxConfig "GlxConfig"
- #define GlxRGlxConfig "GlxConfig"
-
- #ifndef USE_GL
- #define GlxNglxContext "glxContext"
- #define GlxCGlxContext "GlxContext"
- #define GlxRGlxContext "GlxContext"
- #endif
-
- #define GlxNvisualInfo "visualInfo"
- #define GlxRVisualInfo "VisualInfo"
- #define GlxCVisualInfo "VisualInfo"
-
- #define GlxNoverrideColormap "overrideColormap"
- #define GlxCOverrideColormap "OverrideColormap"
-
- #define GlxCCallback "Callback"
- #define GlxNexposeCallback "exposeCallback"
- #define GlxNginitCallback "ginitCallback"
- #define GlxNresizeCallback "resizeCallback"
- #define GlxNinputCallback "inputCallback"
-
- #define GlxCColormap "Colormap"
- #define GlxCDepth "Depth"
- #define GlxCWindow "Window"
-
- #define GlxNuseOverlay "useOverlay"
- #define GlxCUseOverlay "UseOverlay"
- #define GlxNoverlayColormap "overlayColormap"
- #define GlxNoverlayDepth "overlayDepth"
- #define GlxNoverlayVisual "overlayVisual"
- #define GlxNoverlayWindow "overlayWindow"
- #ifndef USE_GL
- #define GlxNoverlayGlxContext "overlayGlxContext"
- #define GlxNoverlayGlxConfig "overlyGlxConfig"
- #endif
- #define GlxNoverlayExposeCallback "overlayExposeCallback"
- #define GlxNuseUnderlay "useUnderlay"
- #define GlxCUseUnderlay "UseUnderlay"
- #define GlxNunderlayColormap "underlayColormap"
- #define GlxNunderlayDepth "underlayDepth"
- #define GlxNunderlayVisual "underlayVisual"
- #define GlxNunderlayWindow "underlayWindow"
- #define GlxNunderlayExposeCallback "underlayExposeCallback"
- #define GlxNusePopup "usePopup"
- #define GlxCUsePopup "UsePopup"
- #define GlxNpopupColormap "popupColormap"
- #define GlxNpopupDepth "popupDepth"
- #define GlxNpopupVisual "popupVisual"
- #define GlxNpopupWindow "popupWindow"
- #define GlxNpopupExposeCallback "popupExposeCallback"
-
- #define GlxNprovideSingleBuffer "provideSingleBuffer"
- #define GlxCProvideSingleBuffer "ProvideSingleBuffer"
- #define GlxNsingleBuffer "singleBuffer"
- #define GlxCSingleBuffer "SingleBuffer"
- #define GlxNprovideStereoBuffer "provideStereoBuffer"
- #define GlxCProvideStereoBuffer "ProvideStereoBuffer"
- #define GlxNstereoBuffer "stereoBuffer"
- #define GlxCStereoBuffer "StereoBuffer"
- #define GlxNaltColormap "altColormap"
- #define GlxNmainWindow "mainWindow"
-
- #ifdef __GLX_MOTIF
- typedef struct _GlxMDrawClassRec *GlxMDrawWidgetClass;
- typedef struct _GlxMDrawRec *GlxMDrawWidget;
-
- extern WidgetClass glxMDrawWidgetClass;
- #else /* not __GLX_MOTIF */
- typedef struct _GlxDrawClassRec *GlxDrawWidgetClass;
- typedef struct _GlxDrawRec *GlxDrawWidget;
-
- extern WidgetClass glxDrawWidgetClass;
- #endif
-
- /* Callback reasons */
- #ifdef __GLX_MOTIF
- #define GlxCR_EXPOSE XmCR_EXPOSE
- #define GlxCR_RESIZE XmCR_RESIZE
- #define GlxCR_INPUT XmCR_INPUT
- #else /* not __GLX_MOTIF */
- /* The same values as Motif, but don't use Motif constants */
- #define GlxCR_EXPOSE 38
- #define GlxCR_RESIZE 39
- #define GlxCR_INPUT 40
- #endif /* __GLX_MOTIF */
-
- #define GlxCR_GINIT 32135 /* Arbitrary number that should neverr clash*/
-
- typedef struct
- {
- int reason;
- XEvent *event;
- Window window;
- int buffer;
- Dimension width, height; /* for resize callback */
- #ifndef USE_GL
- GLXContext context;
- #endif
- } GlxDrawCallbackStruct;
-
-
- #ifdef __GLX_MOTIF
- #ifdef _NO_PROTO
- extern Widget GlxCreateMDraw ();
- #else /* _NO_PROTO */
-
- #if defined(__cplusplus) || defined(c_plusplus)
- extern "C" {
- #endif
-
- extern Widget GlxCreateMDraw (Widget parent, char *name, ArgList arglist, Cardinal argcount);
- #endif /* _NO_PROTO */
-
- #if defined(__cplusplus) || defined(c_plusplus)
- }
- #endif
- #endif /* __GLX_MOTIF */
-
- #endif /* _GlxDraw_h */
-